ASN.1 (Abstract Syntax Notation 1) is the standard defined by ITU for the format of the messages transmitted on network and it provides a standard format for data conversion among the nodes. Each node only cares about those translated from/to ASN.1 while does not necessarily know the format of the data saved in anywhere on network. ASN.1 consists of two parts, one part is ISO 8824/ITU X.208 which describes the data, data type and sequence format in the message, that is, the grammar of data; the other part is ISO 8825/ITU X.209 which describes how to combine each part of data into a message, that is, the basic data encoding rule, which was initially developed as a part of X.409, and later independently become a standard. The 1st generation PKI (Public Key Infrastructure) standard is mainly based on ASN.1, and it is used in SNMP to define the format of the SNMP protocol data unit and object and is widely applied in other areas of the communication and computer.
Therefore, the way of using the format of ASN.1 message to communicate is the common way in telecommunication network management system.
ASN.1 message has the following characteristics:
1. The message has a tree structure which can define hierarchical message nesting as desired.
2. The type of a node in the message can be various, and it can be a simple data type such as INTEGER, GRAPHICSTRING, ENUM, and so on; or a composite data type including children nodes, such as SET, SEQUENCE, SET OF or SEQUENCE OF.
3. In the structures of SET and SEQUENCE, a certain node may not exist, since the corresponding message node is allowed to be set as OPTIONAL which means “may or may not exist”.
4. When ASN.1 message is used, firstly an ASN.1 structure is defined in the ASN.1 message, and then is compiled into an intermediate programming language structure such as Java, C++ by a compiler, and then the communication is implemented by using the corresponding programming language structure.
5. ASN.1 supports BER (Basic Encoding Rules), DER (Distinguished Encoding Rules) and VAL (ASN.1 value notation) to encode the intermediate language structure example into bit stream, but there is a problem when the bit stream is decoded into the medium language structure example. Firstly, it needs to know the structure corresponding to the bit stream so as to use the decoding method of the structure to decode, and if the structure includes ANY (the uncertain type), the data of this type can only be further decoded after its specific type is determined through other member field.
The typical method of using ASN.1 message in C/S software is:
1. Establishing the connection between a client and a server;
2. Interacting the protocols between the client and the server:
a) A message sender filling in the ASN.1 message header and body, wherein the header includes a command code, and the body applies the type of ANY, and its real data type varies depending on the command code;
b) The message sender encoding the message into a bit stream and sending it to a message receiver;
c) The message receiver receiving the bit stream, decoding the message header, and then decoding the message body with the special data type according to the command code therein;
d) The message receiver responding according to the content of the message;
3. The interaction being completed and the connection being disconnected.
A stimulated message is always needed in the interface test tool of message, and the stimulated message has two origins, one is to generate through the explanatory script language and the other is to establish examples of the message structure and further modify the examples through persistent data. However, in application programs, sometimes the message should be persistently saved as a file or saved into the database, and reconstruct the message from the persistent message. Also, it is desired that the data in the file is readable and the data in it can be modified.
Generally, BER is used for transmission in the network management subsystem. However, because it is unreadable and it can not directly recover the ANY data, the BER bit stream is not good for persistently saving the message, so as the DER, which is a BER with unique encoding. While VAL (ASN.1 VALue notation) is a readable name value character format which uses “{” and “}” to perform hierarchical nesting tree marker structure and has the following features:
1. The non-outermost node applies the format of “name value”, and the outermost root node applies the format of “data structure type name value”.
2. For SET, SEQUENCE value, the data is bracketed into “{” and “}”, and the “,” is used to separate the members.
3. For SET OF, SEQUENCE OF value, the data array is bracketed into “{” and “}”, and the “,” is used to separate the elements in the array.
4. For the ANY value, if the data in it is byte string, it is displayed using Hexadecimal system; and if it is a special ASN.1 data type, it is displayed using the format of “special data structure type name value”.
The characteristics of the VAL format make it possible to be directly recovered as ASN.1 message example from the bit stream. However, the present ASN.1 compiling platforms including DSET and ESNACC do not support the function of completely recovering the example of ASN.1 message.